﻿using System;

namespace 泛型
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            //首先根据类的全名获取到type，然后创建实例，1，2，“”就是构造函数需要的参数
            test x = new test();
            //Type type = Type.GetType(x.);
            x.X = 3;
            x.Y = 4;

            var instance = Activator.CreateInstance(x.GetType());
            test2 _test2 = (test2)instance;
            Console.WriteLine(_test2.X + " " + _test2.Y);
            
            

        }
        class test:test2
        {
            
        }
        class test2
        {
            double y;
            int x;
            public int X { get => x; set => x = value; }
            public double Y { get => y; set => y = value; }
        }



    }



}
